#include"head.h"

int rmServe(int net_fd,MYSQL *connection){

    char* argv[3] = {0};

    char protocol[100] = {0};

    recv(net_fd, protocol, sizeof(protocol), 0);


    getToken(protocol, argv);

    char path[100] = {0};



    strcat(path, argv[1]);
    strcat(path, "/");
    strcat(path, argv[2]);


    
    bool stat = false;

    stat = utils_remove_file(connection, argv[0], path);

    
    if(!stat){
        int s = 0;
        send(net_fd, &s, sizeof(int), MSG_NOSIGNAL);
        return -1;
    }
    
    if(stat){
        int s = 1;
        send(net_fd, &s, sizeof(int), MSG_NOSIGNAL);
    }

    return 0;
}



